home *** CD-ROM | disk | FTP | other *** search
/ Clickx 115 / Clickx 115.iso / software / tools / windows / tails-i386-0.16.iso / live / filesystem.squashfs / var / lib / dpkg / info / ppp.postinst < prev    next >
Encoding:
Text File  |  2010-08-08  |  1.4 KB  |  64 lines

  1. #!/bin/sh -e
  2.  
  3. everything() {
  4.  
  5. # install /etc/ppp/pap-secrets and /etc/ppp/chap-secrets from templates,
  6. # if necessary
  7. for file in pap-secrets chap-secrets; do
  8.   if [ -f /etc/ppp/$file ]; then
  9.     TAG=$(head --lines=1 /etc/ppp/$file)
  10.     if [ "$TAG" = "#GENERATED-BY-DEBIAN-INSTALLER#" ]; then
  11.       (sed -e "s/-HOSTNAME-/$HOST/g" /usr/share/ppp/$file; \
  12.         cat /etc/ppp/$file) > /etc/ppp/$file.tmp
  13.       mv /etc/ppp/$file.tmp /etc/ppp/$file
  14.     fi
  15.   else
  16.     sed -e "s/-HOSTNAME-/$HOST/g" < /usr/share/ppp/$file > /etc/ppp/$file
  17.   fi
  18.   chmod 600 /etc/ppp/$file
  19. done
  20.  
  21. # install template provider files
  22. if [ ! -f /etc/ppp/peers/provider ]; then
  23.   install -g dip -m 640 /usr/share/ppp/provider.peer \
  24.             /etc/ppp/peers/provider
  25. fi
  26. if [ ! -f /etc/chatscripts/provider ]; then
  27.   install -g dip -m 640 /usr/share/ppp/provider.chatscript \
  28.             /etc/chatscripts/provider
  29. fi
  30.  
  31. # fix the log files permissions
  32. LOG_FILES="/var/log/ppp.log /var/log/ppp-connect-errors"
  33. for file in $LOG_FILES; do
  34.   [ -e $file ] || continue
  35.   chown root:adm $file
  36.   chmod 640 $file
  37. done
  38.  
  39. }
  40.  
  41. case "$1" in
  42.     configure)
  43.     everything
  44.     ;;
  45.  
  46.     abort-upgrade|abort-remove|abort-deconfigure)
  47.     ;;
  48.  
  49.     *)
  50.     echo "postinst called with unknown argument '$1'" >&2
  51.     exit 1
  52.     ;;
  53. esac
  54.  
  55. # Automatically added by dh_installinit
  56. if [ -x "/etc/init.d/pppd-dns" ]; then
  57.     update-rc.d pppd-dns start 38 S . >/dev/null || exit $?
  58. fi
  59. # End automatically added section
  60.  
  61.  
  62. exit 0
  63.  
  64.